package com.supermarket.seefood51

import android.os.Bundle
import android.view.WindowManager
import com.trello.rxlifecycle.components.support.RxAppCompatActivity


abstract class BaseActivity(var layoutId: Int) : RxAppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN)
        setContentView(layoutId)
        initView()
        initData()
        initListener()

    }
    abstract fun initData()
    open fun initView() {

    }

    open fun initListener() {

    }



//    open fun initToolbar(text: Int=R.string.no_title, isShowBackBar: Boolean = true) {
//        val toolbar: Toolbar? = find(R.id.toolbar)
//        val tvTitle: TextView? = find(R.id.tv_toolbar_title)
//
//        toolbar?.let {
//            setSupportActionBar(toolbar)
//            val actionBar = supportActionBar
//            actionBar?.let {
//                actionBar.setDisplayHomeAsUpEnabled(isShowBackBar)
//                actionBar.setDisplayShowTitleEnabled(false)
//                toolbar.setNavigationOnClickListener() { onBackPressed() }
//            }
//            tvTitle?.text = getString(text)
//        }
//    }text
}

